﻿/*
 * 公共弹出提示框
 * */
(function () {
    var ogEle = '';
	    ogEle +='<div class="modal fade" id="confirmKe">';
	    ogEle +='  <div class="modal-dialog">';
	    ogEle +='    <div class="modal-content">';
	    ogEle +='  	 	<div class="modal-header">';
	    ogEle +='    	  <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>';
	    ogEle +='    	  <h4 class="modal-title">提示</h4>';
	    ogEle +='  	 	</div>';
	    ogEle +='      <div class="modal-body"><h3 class="text-center"><p style="padding-bottom: 10px;"><small id="confirm_msg"></small></p></h3></div>';
	    ogEle +='		<div class="modal-footer">';
	    ogEle +='			<button type="button" id="confirmOkBtn" class="btn btn-warning ke-btn-master">确定</button>';
	    ogEle +='			<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>';
	    ogEle +='		</div>';
	    ogEle +='    </div>';
	    ogEle +='  </div>';
	    ogEle +='</div>';

    $('body').append(ogEle);
})();

// msg: 提示内容；callback: 回调形参
var confirmKe = function(msg, callback) {

	$('#confirm_msg').html('<i class="icon-warning-sign"></i> '+msg);
	$('#confirmKe').modal('show');
	
	if(typeof(callback) == 'function') $('#confirmOkBtn').unbind().bind('click', callback)
	
}
